﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using BackEnd.Common;
using BusinessLayer.RegInfo;
using BusinessLayer.RegInfo.Entities;

namespace BackEnd.Controllers
{
    public class ValidationController : Controller
    {
        [HttpPost]
        public JsonResult AccountEdit_IsEmail_Available(int Id, string Email)
        {            
            Account account = new AccountBL().GetByEmail(Email);
            return Json(account == null || account.Id == Id, JsonRequestBehavior.AllowGet);
        }

    }
}
